package com.lagou.consumer;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.lagou.service.HelloService;
import java.io.IOException;

/**
 * <h1>服务消费者主类</h1>
 * @author yzh
 */
public class Consumer {

    public static void main(String[] args) throws IOException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"classpath:dubbo-consumer.xml"});
        HelloService helloService = context.getBean(HelloService.class);
        while (true) {
            System.in.read();
            try {
                String result = helloService.sayHello("world");
                System.out.println("result:"+result);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
